import cache from '@/plugins/cache'
/**
 * @file 公共配置
 */

//页码
export const pageConfig = {
  pageIndex: 1,
  pageSize: 20,
  total: 0
}
// 设置系统参数
export const setSystemParams = (list: any) => {
  const obj = {} as any
  list.forEach((item: any) => {
    obj[item.parameterCode] = item.parameterValue
  })
  cache.local.setJSON('systemParams', obj)
}
// 获取系统参数
export const getSystemParams = (key: any) => {
  const obj = cache.local.getJSON('systemParams')
  if (obj) {
    return obj[key]
  } else {
    return null
  }
}
export const systemCode = '01'
